home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
CYBERVILLAGE
/
ANT
/
ANTUTILS.ZIP
/
!GetmyMail
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1998-12-17
|
7KB
|
303 lines
Getmyymail by Stuart Halliday
1998
V1.00
errorbox(
,"Error at "+
$+" "+
"OS_GetEnv"
command%
&command$=
getlowerstring(command%)
9command$=
command$,
(command$)-
command$,""" ")-1)+
mail%=3
command$,"m")
mail%=1
command$,"n")
mail%=2
q% &4000,buffer% 256,iconnames$(50),titlename$(255),win%(255)
initwimp("GetMyMail")
("Set getmymail$loaded yes")
findicon("on line") =
online%=
online%=
"OS_GSTrans","<getmymail%timelimit>",buffer%,256
*timelimit%=
getlowerstring(buffer%))
timelimit%<2
timelimit%=1
closedown%=
wait up to 1 min for ANT Suite to load completely
findicon("internet") =
t%=
found%=
"5
>t%+100
found%=
findicon("internet"):t%=
>T%+(1*6000)
found%=
OK, InetSuite is now loaded, but force a wait of 2sec
t%=200
:fin%=
>T%+t%
sendmailmessage(3)
sendmailmessage(1)
fin%=
fin%=
recheck every 10secs to see if INETSUITE has finished transfering
BUT if more than timelimit% in mins have passed then switch off anyway!
found%=
>T%+(timelimit%*6000)
suitefinished%=
online% =
no_transfers_are_in_progress=
disconnect / go offline
&4AF53, 0, 0, "Remote"
&4AF53, 2, 0, "Remote"
reset Modem
"OS_SerialOp",2,200
"OS_SerialOp",3,"A"
"OS_SerialOp",3,"T"
"OS_SerialOp",3,"Z"
"OS_SerialOp",3,
closedown
sendmailmessage(type%)
type%
mail%=1, 1
mail%=3:
email transfer
buffer%!0=32
buffer%!12=0
buffer%!16=&46005
buffer%!20=1
Z*
"Wimp_SendMessage",17,buffer%,0
mail%=1, 1
mail%=3:
email send only
buffer%!0=32
buffer%!12=0
buffer%!16=&46005
buffer%!20=2
c*
"Wimp_SendMessage",17,buffer%,0
mail%>1:
News transfer
buffer%!0=32
buffer%!12=0
buffer%!16=&46005
buffer%!20=3
k*
"Wimp_SendMessage",17,buffer%,0
mail%>1:
News send only
buffer%!0=32
buffer%!12=0
buffer%!16=&46005
buffer%!20=4
s*
"Wimp_SendMessage",17,buffer%,0
"Wimp_Poll",0,q%
reason%
reason%
17,18,19 :
message
closedown%=
closedown
closedown
("UNSET getmymail$loaded")
"XWimp_CloseDown"
message
q%!16
0 :closedown%=
&400C7 :taskname$=
getlowerstring(q%+28)
&46006 :
(q%!20) = 1
suitefinished%=
initwimp(taskname$)
"Wimp_Initialise",200,&4B534154,taskname$
,taskhandle%
closedown%=
suitefinished%=
findicon(iconwanted$)
win%=-2:found%=
iconwanted$,1)) =0
get_names_of_icons(win%)
loop%=0
nooficons%
iconnames$(loop%)=iconwanted$
found%=
loop%=nooficons%
=found%
get_names_of_icons(windowread%)
!q%=windowread%
"Wimp_GetWindowInfo",,q%
ic%=0
!q%=20:q%!12=0:q%!16=0
"XWimp_SendMessage",19,q%,windowread%,ic%
,,task%
nooficons%=(q%!88)-1
ic%=0
nooficons%
windowread%=-2
!q%=20:q%!12=0:q%!16=0
>
"XWimp_SendMessage",19,q%,windowread%,ic%
,,task%
5 iconnames$(ic%)=
iconname(task%,windowread%,ic%)
OSCLI("SET icon"+STR$ic%+" "+iconname$)
iconname(task%,window%,icon%)
valid$=""
icon%
-1 :iconname$="Background, no icon present"
-2 :iconname$="Back Icon"
-3 :iconname$="Close Icon"
-4 :iconname$="Title Bar"
-5 :iconname$="Toggle Icon"
-6 :iconname$="Scroll Up"
-7 :iconname$="Vertical Bar"
-8 :iconname$="Scroll Down"
-9 :iconname$="Adjust Size"
-10 :iconname$="ScrollRight"
-11 :iconname$="Horizontal Bar"
-12 :iconname$="Scroll Left"
!q%=window%
q%!4=icon%
"Wimp_GetIconState",,q%
iconname$=""
((q%!24)
256)=0
( iconname$=
getlowerstring(q%+28)
task%=0
iconname$="Unknown"
((q%!24)
1)=0
. iconname$=
getremstring(task%,q%!28)
(q%!32)=-1
valid$=""
+ valid$=
getremstring(task%,q%!32)
' iflag%=((q%!24)
&F000) >> 12
. iconname$=
getremstring(task%,q%!28)
>
iconname$=""
iconname$=
valid$,2,
valid$,",")-2)
=iconname$
getremstring(task%,ptr%)
$buffer%="<Unknown>"
"XWimp_TransferBlock",task%,ptr%,taskhandle%,buffer%,256
ptr%=buffer%
getlowerstring(buffer%)
getlowerstring(ptr%)
p$=""
(?ptr%>31
?ptr%<256)
(p$)<255
?ptr%>=65
?ptr%<=90
p$+=
((?ptr%)+32)
p$+=
?ptr%
ptr%+=1
getlist
winnumber%=0
win%(winnumber%)=bottom%
winnumber%+=1
3 win%(winnumber%)=
nextup(win%(winnumber%-1))
winnumber%+=1
win%(winnumber%-1) = -1
winnumber%-=1
winnumber%>100
winnumber%=100
winnumber%<0
winnumber%=0
win%(winnumber%)=-2
loop%= 0
winnumber%
win%=win%(loop%)
- titlename$(loop%)=
get_title_name(win%)
OSCLI("Set winwatch"+STR$ loop%+" "+titlename$(loop%))
get_title_name(gwindow%)
no_of_icons%
!q%=gwindow%
"XWimp_GetWindowInfo",,q%
no_of_icons%=q%!88
waminx%=q%!44
waminy%=q%!48
wamaxx%=q%!52
wamaxy%=q%!56
h%=wamaxy%-waminy%
w%=wamaxx%-waminx%
((q%!60)
256)=0
* windowname$=
getlowerstring(q%+76)
7
windowname$="<Untitled>"
windowname$="None"
val%=?(q%+76)
icon%=-1
!q%=20:q%!12=0:q%!16=0
=
"XWimp_SendMessage",19,q%,gwindow%,icon%
,,task%
/ windowname$=
getremstring(task%,q%!76)
windowname$=""
< windowname$="#w"+
w%+ " h"+
h%+" n"+
no_of_icons%
gwindow%=-2
windowname$="icon bar"
=windowname$
getbottom
!buffer%=-2
"XWimp_GetWindowState",,buffer%
bottom%=buffer%!28
=bottom%
nextup(window%)
!buffer%=window%
"XWimp_GetWindowState",,buffer%
=buffer%!28
no_transfers_are_in_progress
& w$="document being fetched"
flag%=
bottom%=
getbottom
getlist
w%=winnumber%
"Wimp_Poll",0,q%
w$=titlename$(w%)
flag%=win%(w%):w%=0
=flag%
errorbox(error%,error$,flags%)
5( !buffer%=error%:$(buffer%+4)=error$
"Wimp_ReportError",buffer%,flags%,taskname$
,result%
result%=2
"Wimp_CloseDown":
"OS_Exit"